package org.meb.spdwldr.core;

import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map.Entry;

public class SortOrder {

	public enum Direction {
		ASC, DESC
	}

	private LinkedHashMap<String, Direction> info = new LinkedHashMap<String, Direction>();

	public Iterator<Entry<String, Direction>> iterator() {
		return info.entrySet().iterator();
	}

	public void clear() {
		info.clear();
	}

	public void asc(String property) {
		info.remove(property);
		info.put(property, Direction.ASC);
	}

	public void desc(String property) {
		info.remove(property);
		info.put(property, Direction.DESC);
	}

	public void none(String property) {
		info.remove(property);
	}

	public boolean isEmpty() {
		return info.isEmpty();
	}
}
